<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        form{
            width: 300px;
            height: 300px;
            margin: 100px auto;
        }
    </style>
</head>

<body>
    <form action="">
        <label for="">邮箱</label>
        <input type="text">
    </form>

    <script>
        const rg = /^[\w]{3,6}@qq.com$/

        const inputObj = document.querySelector("input")
        inputObj.addEventListener("blur",function(){
            // console.log("hh")
            // console.log(rg.test("111@qq.com"))
            // console.log(inputObj.value)
            console.log(rg.test(inputObj.value))
        })
    </script>
</body>

</html>